package com.buyu.mvvm.mvvm.activity;

import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.databinding.ObservableField;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;


import com.buyu.mvvm.mvvm.R;
import com.buyu.mvvm.mvvm.databinding.ActivityLoginBinding;
import com.buyu.mvvm.mvvm.di.ViewModelSubComponent;
import com.buyu.mvvm.mvvm.viewmodel.LoginViewModel;

import javax.inject.Inject;

/**
 * @author cui-hl
 * @version 1.0 2018/11/7
 */
public class LoginActivity extends BaseActivity {

    @Inject
    ViewModelSubComponent builder;

    LoginViewModel loginViewModel;

    ActivityLoginBinding binding;

    public final ObservableField<String> user = new ObservableField<>();
    public final ObservableField<String> pass = new ObservableField<>();

    private LoginActivity activity;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        activity = this;
        binding = DataBindingUtil.setContentView(this, R.layout.activity_login);
        binding.setViewModel(this);

        loginViewModel=builder.loginViewModel();

    }

    public void setLogin(View view) {
        loginViewModel.initData();
       Intent intent = new Intent(this, MainActivity.class);
        startActivity(intent);
    }

    public void setRegister(View view) {

    }

    public void setForget(View view) {

    }

    public void setQQ(View view) {

    }

    public void setWechat(View view) {

    }

}
